//
//  YWReportTroubleModel.m
//  maintain
//
//  Created by 烟雨云渊 on 17/3/2.
//  Copyright © 2017年 ewin. All rights reserved.
//

#import "MJExtension.h"
#import "YWReportTroubleModel.h"
#import "YWHandler.h"

@implementation YWReportTroubleModel
+ (NSArray *)mj_ignoredPropertyNames
{
    return @[@"uploadFail",@"read"];
}

+ (NSDictionary*)mj_objectClassInArray
{
    return @{ @"pictures" : @"YWPicture",
              @"equipmentFields" :   @"YWEquipmentFieldRecord",
              @"circulationInfos" : @"YWCirculationInfo",
              @"records" : @"YWEquipmentTroubleRecordJson",
              @"observers" : @"YWHandler"};
}
- (void)mj_keyValuesDidFinishConvertingToObject{
    NSMutableString *atUserName = [[NSMutableString alloc] init];
    [self.observers enumerateObjectsUsingBlock:^(YWHandler*  _Nonnull handler, NSUInteger idx, BOOL * _Nonnull stop) {
        if (atUserName.length && idx!=0) {
            [atUserName appendString:@","];
        }
        [atUserName appendString:[@(handler.uniqueId) stringValue]];
    }];
    self.observerIds = [NSString stringWithFormat:@"%@",atUserName];
}
@end
